//
//  YueKaNetWork.m
//  Shengzhuli
//
//  Created by subook on 2017/10/12.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "YueKaNetWork.h"
#import "GFXNetworkHandle.h"


NSString * const bannerList = @"meca/banner";//轮播列表  1
NSString * const mainKaList = @"list/maca";//首页大咖列表  2
NSString * const KaMessage = @"maca/information";//大咖信息  3
NSString * const KaProductList = @"list/maca/works";//大咖作品列表  4
NSString * const createKaorder = @"auth/maca/appointment/create";//创建约咖信息  5
NSString * const haveYueList = @"auth/list/maca/appointment";//预约的大咖列表  6

@implementation YueKaNetWork
//1
+(void)getBannerListWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSArray *))response {
    
    [[GFXNetworkHandle shareHandle] post:bannerList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
//2
+(void)getKaListWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSArray *))response {
    [[GFXNetworkHandle shareHandle] post:mainKaList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
//3
+(void)getKaMessageWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSDictionary *))response {
    [[GFXNetworkHandle shareHandle] post:KaMessage params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
//4
+(void)getKaProductListWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSArray *))response {
    [[GFXNetworkHandle shareHandle] post:KaProductList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
//5
+ (void)getKaProductOrderWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSDictionary *))response {
    [[GFXNetworkHandle shareHandle] post:createKaorder params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
//6
+(void)getYueedKaWithParame:(NSDictionary *)parames response:(void (^)(BOOL, NSString *, NSArray *))response {
    [[GFXNetworkHandle shareHandle] post:haveYueList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            NSLog(@"status = %@",json);
            response(YES,json[@"message"],json[@"result"]);
        }else {
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}
@end
